class Role:
    def __init__(self, name, weapon):
        self.name = name
        self.weapon = weapon

    def attack(self, target):
        return f'{self.name}-----{self.weapon}---{target}'

if __name__ == '__main__':
    r1 = Role('rocky', 'tom')
    print(r1.attack('piap'))
    print('---', r1.name)

    r2 = Role('pingping', 'daodao')
    print(r2.attack('tom'))
    print('---', r2.name)
